const StatsPlugin = require('stats-webpack-plugin');

module.exports = {
  publicPath: '/schema-inspector',
  configureWebpack: {
    devtool: 'source-map',
    entry: {
      main: './src/main.js',
    },
    plugins: [
      new StatsPlugin('stats.json', {
        chunkModules: true,
        exclude: [
          /node_modules/,
          /schema-main[\\\/]schema-json/,
          /src[\\\/]base/,
          /src[\\\/]service/
        ]
      })
    ]
  },
  devServer: {
    port: 8084,
    proxy: {
      '/indicator': {
        target: 'http://szapp.tendcloud.com',
        ws: true,
        changeOrigin: true
      },
      '/cohort': {
        target: 'http://szapp.tendcloud.com',
        ws: true,
        changeOrigin: true
      },
      '/app': {
        target: 'http://szapp.tendcloud.com',
        ws: true,
        changeOrigin: true
      },
      '/applog': {
        target: 'http://szapp.tendcloud.com',
        ws: true,
        changeOrigin: true
      },
      '/metaDataService': {
        target: 'http://localhost:3000',
        ws: true,
        changeOrigin: true
      },
      '/metaArrayService': {
        target: 'http://localhost:3000',
        ws: true,
        changeOrigin: true
      },
      '/olapReport': {
        target: 'http://szapp.tendcloud.com',
        ws: true,
        changeOrigin: true
      }
    }
  }
};
